/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.Random;
import java.util.stream.Stream;

/**
 * <p>Project: jse2303 - Ex1</p>
 * <p>Powered by webrx On 2023-07-25 17:37:18</p>
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex1 {
    public static void main(String[] args) {
        Random rand = new Random();
        Stream<Integer> ss = Stream.generate(() -> rand.nextInt(1, 101)).limit(10);
        System.out.println(ss.filter(e -> e % 2 == 0).reduce(0, (a, b) -> a + b));
    }
}
